#include <cstdio>

int main( )
{
    bool have[ 1001 ];
    int i, t1, minn, n, m, c = 1;
    while ( scanf("%d%d", &n, &m) != EOF )
    {
        if ( n == 0 && m == 0 )
            break;
        for ( i = 1; i <= m * n; i++ )
            have[ i ] = false;
        for ( i = 0; i < m; i++ )
        {
            scanf("%d", &t1);
            have[ t1 ] = true;
        }
        t1 = minn = 0;
        for ( i = m * n; i >= 1; i-- )
        {
            if ( have[ i ] )
                t1++;
            else
                t1--;
            if ( minn < t1 )
                minn = t1;
        }
        printf("Case %d: %d\n", c++, minn);
    }
    return 0;
}
